<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'documents-form',
	'enableAjaxValidation'=>false,
        'htmlOptions'=>array(
            'enctype'=>'multipart/form-data',
        )
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'docname'); ?>
            
		<?php echo $form->textField($model,'docname',array('size'=>60,'maxlength'=>150)); ?>
		<?php echo $form->error($model,'docname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'filename'); ?>
                
                
		<?php echo $form->fileField($model,'file'); ?>
                <div class="model-data">
                    <?php echo $model->filename;?>
                </div>
		<?php echo $form->error($model,'filename'); ?>
	</div>
        
        <?php if( ! $model->isNewRecord):?>
	<div class="row">
		<?php echo $form->labelEx($model,'dateadded'); ?>
		<div class="model-data">
                    <?php echo $model->dateadded;?>
                </div>
		<?php echo $form->error($model,'dateadded'); ?>
	</div>
        <?php endif?>

        <?php echo $form->hiddenField($model,'custno',array('size'=>7,'maxlength'=>7)); ?>
        <?php echo $form->hiddenField($model,'dispatch');?>

        <?php echo $form->hiddenField($model,'locno',array('size'=>5,'maxlength'=>5)); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'notes'); ?>
		<?php echo $form->textArea($model,'notes'); ?>
		<?php echo $form->error($model,'notes'); ?>
	</div>
        
        
	<div class="row_buttons">
		<?php echo CHtml::submitButton($model->getSubmitButtonText(),array('disabled'=>($model->lockby!=NULL && $model->lockby!=Yii::app()->user->name)?'disabled':NULL,)); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->